package com.wisemoresystem.seal.util;

import java.util.List;


public class InTools {

	//将List<String>转换为String 'a','b'类型
	public static String listToString(List<String> list) {
		String str = "";
		for(String s:list){
			str = str+"'"+s+"',";
		}
		if(str.length()>0){
			str = str.substring(0,str.length()-1); 
		}
		
		return str;
	}
	
	//将用,间隔的字符串转换为sql in中的字符串	即a,b ->'a','b'
	public static String stringToSqlString(String string){
		String str = "";
		String[] strs = string.split(",");
		for(String s:strs){
			str = str+"'"+s+"',";
		}
		if(str.length()>0){
			str = str.substring(0,str.length()-1); 
		}
		return str;
	}
}
